Eliminate x86_64 idt_table.
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Mon, 20 Feb 2006 17:32:29 +0000 (17:32 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Mon, 20 Feb 2006 17:32:29 +0000 (17:32 +0000)
Add CONFIG_X86_NO_IDT to exclude all code which references the idt table.
Also fix the non-Xen cpu_gdt_init() handling.

From: Jan Beulich <JBeulich@novell.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
linux-2.6-xen-sparse/arch/x86_64/Kconfig
linux-2.6-xen-sparse/arch/x86_64/kernel/head-xen.S
linux-2.6-xen-sparse/arch/x86_64/kernel/setup64-xen.c
linux-2.6-xen-sparse/arch/x86_64/kernel/traps-xen.c
linux-2.6-xen-sparse/include/asm-x86_64/mach-xen/asm/desc.h

index eaadb1f12911ee87bd8b5fa3694cc212600ef5dd..77840c54bfd935e1c595dc62788128829e3f470e 100644 (file)
@@ -130,6 +130,11 @@ config X86_NO_TSS
        depends on X86_64_XEN
        default y
 
+config X86_NO_IDT
+       bool
+       depends on X86_64_XEN
+       default y
+
 #
 # Define implied options from the CPU selection here
 #
index 90769eee1d5798c497c3df1066c6ffebb7cb40ec..749f201a3ceeba62985e2a5e48abdead94019a44 100644 (file)
@@ -129,14 +129,6 @@ gdt_end:
        /* zero the remaining page */
        .fill PAGE_SIZE / 8 - GDT_ENTRIES,8,0
 
-       .section .bss, "aw", @nobits
-       .align L1_CACHE_BYTES
-ENTRY(idt_table)       
-       .rept   256
-       .quad   0
-       .quad   0
-       .endr
-
 /*
  * __xen_guest information
  */
index 6bed7e2196504ee12547f127c6eb3c9658db534d..0c72b9b369cd97330182a28c149a8da1382af17c 100644 (file)
@@ -40,7 +40,9 @@ cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;
 struct x8664_pda *_cpu_pda[NR_CPUS] __read_mostly;
 struct x8664_pda boot_cpu_pda[NR_CPUS] __cacheline_aligned;
 
+#ifndef CONFIG_X86_NO_IDT
 struct desc_ptr idt_descr = { 256 * 16, (unsigned long) idt_table }; 
+#endif
 
 char boot_cpu_stack[IRQSTACKSIZE] __attribute__((section(".bss.page_aligned")));
 
@@ -155,13 +157,7 @@ static void switch_pt(void)
 
 void __init cpu_gdt_init(struct desc_ptr *gdt_descr)
 {
-#ifdef CONFIG_SMP
-       int cpu = stack_smp_processor_id();
-#else
-       int cpu = smp_processor_id();
-#endif
-
-       asm volatile("lgdt %0" :: "m" (cpu_gdt_descr[cpu]));
+       asm volatile("lgdt %0" :: "m" (*gdt_descr));
        asm volatile("lidt %0" :: "m" (idt_descr));
 }
 #endif
@@ -285,12 +281,7 @@ void __cpuinit cpu_init (void)
 #endif
 
        cpu_gdt_descr[cpu].size = GDT_SIZE;
-#ifndef CONFIG_XEN 
-       asm volatile("lgdt %0" :: "m" (cpu_gdt_descr[cpu]));
-       asm volatile("lidt %0" :: "m" (idt_descr));
-#else
        cpu_gdt_init(&cpu_gdt_descr[cpu]);
-#endif
 
        memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8);
        syscall_init();
index 242fe03f5f708193b30daf42960c7001c56063a5..0568511c06bfa9961da844b7cb32610bf53e4d5b 100644 (file)
@@ -47,7 +47,9 @@
 #include <asm/proto.h>
 #include <asm/nmi.h>
 
+#ifndef CONFIG_X86_NO_IDT
 extern struct gate_struct idt_table[256]; 
+#endif
 
 asmlinkage void divide_error(void);
 asmlinkage void debug(void);
@@ -986,10 +988,6 @@ void __init trap_init(void)
                 printk("HYPERVISOR_set_trap_table faild: error %d\n",
                        ret);
 
-#ifdef CONFIG_IA32_EMULATION
-       set_system_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
-#endif
-       
        /*
         * Should be a barrier for any external CPU state.
         */
index 292f8a712e8d04004d6af3caeaa0857abdf50a16..00f8c4182e63fafaf6e4a40359bb5a08a28497fc 100644 (file)
@@ -90,7 +90,9 @@ static inline void clear_LDT(void)
  * something other than this.
  */
 extern struct desc_struct default_ldt[];
+#ifndef CONFIG_X86_NO_IDT
 extern struct gate_struct idt_table[]; 
+#endif
 extern struct desc_ptr cpu_gdt_descr[];
 
 /* the cpu gdt accessor */
@@ -113,6 +115,7 @@ static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsig
        memcpy(adr, &s, 16); 
 } 
 
+#ifndef CONFIG_X86_NO_IDT
 static inline void set_intr_gate(int nr, void *func) 
 { 
        BUG_ON((unsigned)nr > 0xFF);
@@ -135,6 +138,7 @@ static inline void set_system_gate_ist(int nr, void *func, unsigned ist)
 {
        _set_gate(&idt_table[nr], GATE_INTERRUPT, (unsigned long) func, 3, ist);
 }
+#endif
 
 static inline void set_tssldt_descriptor(void *ptr, unsigned long tss, unsigned type, 
                                         unsigned size)